Passed
Pull Request — dev (#7)
by Oscar
03:03
created

NavBar.tsx ➔ NavBar   A

Complexity

Conditions 4

Size

Total Lines 42
Code Lines 33

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 33
dl 0
loc 42
rs 9.0879
c 0
b 0
f 0
cc 4
1
import React from "react";
2
import { ScrollView, Image, Text, View, StyleSheet, StatusBar, Button, Pressable } from 'react-native';
3
import Icon from 'react-native-vector-icons/Octicons';
4
5
6
7
export default function NavBar({navigation}) {
8
    function DrawerButton({navigation}) {
9
        return (
10
          <Pressable style={[styles.drawer, styles.shadowProp]} onPress={() => navigation.openDrawer()}> 
11
            <Icon 
12
            name='three-bars' 
13
            size={30} 
14
            color='black'
15
            />
16
          </Pressable>
17
        );
18
      };
19
20
      function HowToDrive({navigation}) {
21
        return (
22
            <Pressable style={[styles.info, styles.shadowProp]}>
23
                <Text>How to drive?</Text>
24
            </Pressable>
25
        )
26
      }
27
28
      function Drive({navigation}) {
29
        return (
30
            <Pressable style={[styles.drawer, styles.shadowProp]}> 
31
              <Icon 
32
              name='paper-airplane' 
33
              size={30} 
34
              color='black'
35
              />
36
            </Pressable>
37
          );
38
      }
39
40
    return (
41
        <View style={styles.container}>
42
            <DrawerButton navigation={navigation}/>
43
            <HowToDrive navigation={navigation}/>
44
            <Drive navigation={navigation}/>
45
        </View>
46
    )
47
}
48
49
const styles = StyleSheet.create({
50
    container: {
51
        // flex: 1,
52
        position: 'absolute',
53
        // backgroundColor: 'red',
54
        // height: 60,
55
        justifyContent: 'space-evenly',
56
        width: '100%',
57
        flexDirection: 'row',
58
    },
59
    info: {
60
        // position: 'absolute',
61
        width: 250,
62
        height: 50, 
63
        // left: 50,
64
        backgroundColor: 'white',
65
        marginTop: 50,
66
        borderRadius: 25,
67
        justifyContent: 'center',
68
        alignItems: 'center'
69
    },
70
71
    drawer: {
72
        // position: 'absolute',
73
        width: 50,
74
        height: 50, 
75
        // left: 50,
76
        backgroundColor: 'white',
77
        marginTop: 50,
78
        borderRadius: 25,
79
        justifyContent: 'center',
80
        alignItems: 'center',
81
    },
82
    
83
    shadowProp: {
84
        elevation: 5,
85
        shadowColor: 'black'
86
      },
87
});